import Vue from 'vue'
import VueRouter from 'vue-router'

import Layout from '@/Layout'
Vue.use(VueRouter)
 const routes=[
    {
        path:'/detail',
        component:()=>import('@/view/detail')
    },
    {
        path:'/login',
        component:()=>import('@/view/login')
    },
    {
        path:'/',
        reddirect:'/home'
    },
    {
        path:'/home',
        reddirect:'/home/goods',
        component:Layout,
        children:[
            {
                path:'/home/goods',
                component:()=>import('@/view/goods')
            },
            {
                path:'/home/comment',
                component:()=>import('@/view/comment')
            },
            {
                path:'/home/shop',
                component:()=>import('@/view/shop')
            },
        ]
    },
 ]
const router = new VueRouter({
    routes
})
 
//导出
export default router